import 'package:boss/ui/page/marketing/coupon/couponList/provider/coupon_list_provider.dart';
import 'package:boss/ui/widget/custom_tab.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'coupon_list.dart';

class CouponListBrowser extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Consumer<CouponListProvider>(
      builder: (context, provider, _) => CustomTab(
        tabs: ['进行中', '已失效'],
        isScrollable: false,
        padding: EdgeInsets.only(top: 30.w, bottom: 15.w),
        tabViews: <Widget>[
          CouponList(
              provider.validCouponList, provider.queryValidCouponList, 0),
          CouponList(
              provider.invalidCouponList, provider.queryInvalidCouponList, 1),
        ],
      ),
    );
  }
}
